import request from '@/utils/request'
export function getAllGardList(params) {
  return request({
    url: '/api/access/control/device/list',
    method: 'get',
    params
  })
}


export function getGroups() {
  return request({
    url: '/api/access/control/device/group/list',
    method: 'get',
  })
}


export function setGroup(params) {
  let url='/api/access/control/device/assign/group?code='+params.code
  params.indexCodes.forEach((item) => {
    url+=('&indexCodes='+item)
  })
  return request({
    url: url,
    method: 'get',
  })
}

export function deleteFromGroup(params) {
  
  return request({
    url: '/api/access/control/device/delete/group',
    method: 'delete',
    params: {
      indexCode:params
    }
  })
}